#include <QtGui/QApplication>
#include <QColor>
#include "mainwindow.h"
#include "myprocess.h"
#include "mplayerprocess.h"
#include "mplayerwindow.h"
int hwnd;
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    MainWindow w;
     //hwnd=(int)w.winId();
   // MplayerLayer *wp;
   //wp=w.videoLayer();
   // hwnd=(int)wp->winId();
    MplayerProcess p;

    //QPalette p1 = w.palette();
     //p1.setColor(w.backgroundRole(), 0x202020);
   // w.setPalette(p1);
     //w.setColorKey(0x202020);

   // p.setStandardErrorFile("error.txt");
   // p.setStandardOutputFile("stdO.txt");
    p.clearArguments();
           // p.addArgument("mplayer/funclib.exe");
     p.addArgument("mplayer/mplayer.exe");
     p.addArgument("-wid");
     p.addArgument( QString::number( (int) hwnd) );
     p.addArgument("-colorkey");

     QString s;
     s=s.sprintf("0x%02x%02x%02x", 0x20, 0x20,0x20 );

     p.addArgument(s);
    // p.addArgument("  ");
     p.addArgument("a.avi");


    p.start();
    if(p.waitForStarted(5000))
        qWarning("p started");
    else
        qWarning("p error");
//Qt::WindowFlags flags = 0;
//w.setWindowFlags(Qt::CustomizeWindowHint);
w.show();
    return a.exec();
}
